#include "memory.h"

typedef struct node {
    char *pattern;
    char **dest;
    size_t dest_depth;
    struct node *next;
} cfglst;

typedef cfglst *ptr_cfglst;

ptr_cfglst cfglst_init(void);
void cfglst_append(ptr_cfglst *head,
                   char *pattern, char **dest, size_t dest_depth);
void cfglst_free(ptr_cfglst list);

#define cfglst_foreach(curr) \
    for (; curr != NULL; curr = curr->next)
